package working;
import java.util.ArrayList;

abstract public class Scheduler {
   ArrayList<Process> readyQueue, finishQueue, queue;
   int clock;
   Process P, T;
   boolean idle;
   public Thread thread;
  
   public Scheduler(ArrayList<Process> q, int c) {
      queue = q;      
      clock = c-1; // stagger for run loop
      idle = true;
      readyQueue = new ArrayList<Process>();
      finishQueue = new ArrayList<Process>();      
   }
  
   public Process processready(int tick) {
      for (int j=0; j<queue.size(); j++)
         if ((queue.get(j)).getArrival() <= tick)
            return queue.get(j);
      return null;
   }
  
   public void resetQueue() {
      readyQueue.clear();
      finishQueue.clear();
      queue.clear();      
   }
} 
